package FlyweightOne;

import java.util.HashMap;
import java.util.Map;

public class ConcreteCompositeFlyweight implements Flyweight{
	private Map<Character, Flyweight> map = new HashMap<Character, Flyweight>();
	
	/*
	 * 增加一个新的单纯享元对象到聚集中
	 */
	public void add(Character key, Flyweight fly) {
		map.put(key, fly);
	}
	
	
	/*
	 * 外蕴状态作为参数传入到方法中
	 */
	public void operation(String state) {
		/*Flyweight fly = null;
		for(Object object : map.keySet()) {
			fly = map.get(object);
			fly.operation(state);
		}*/
		System.out.println("toher");
	}
	
}
